﻿<?php
//$v_str_answerer_information = "";
if ($v_qa_id >0) {
	$v_question_title = $arr_single_qa_question['C_QUESTION_TITLE'];
	$v_question_content = $arr_single_qa_question['C_QUESTION_CONTENT'];
	$v_questioner_name = $arr_single_qa_question['C_QUESTIONER_NAME'];
	$v_questioner_add = $arr_single_qa_question['C_QUESTIONER_ADD'];	
	$v_questioner_tell = $arr_single_qa_question['C_QUESTIONER_TEL'];
	$v_questioner_email = $v_questioner_email['C_QUESTIONER_EMAIL'];
	$v_questioner_date= _yyyymmdd_to_ddmmyyyy($arr_single_qa_question['C_QUESTION_DATE']);
	$v_answer_content = $arr_single_qa_question['C_ANSWER_CONTENT'];
	
	$v_answerer_name = $arr_single_qa_question['C_ANSWERER_NAME'];
	$v_answer_date= _yyyymmdd_to_ddmmyyyy($arr_single_qa_question['C_ANSWER_DATE']);

	$str_questioner_information="(".$v_questioner_name;

	if (strlen($v_questioner_add)!=0){
		$str_questioner_information=$str_questioner_information.", ".$v_questioner_add;
		}
	if (strlen($v_questioner_tell)!=0){
		$str_questioner_information=$str_questioner_information.", &#272;T : ".$v_questioner_tell;
		}
	if (strlen($v_questioner_email)!=0){
		$str_questioner_information=$str_questioner_information.", Email : ".$v_questioner_email;
		}
	$str_questioner_information = $str_questioner_information . ',  ng&#224;y '.$v_questioner_date.")";	
	
	$str_answerer_information="(";
	if (strlen($v_answerer_name)!=0){
		$str_answerer_information=$str_answerer_information.$v_answerer_name.", ";
		}	
	$str_answerer_information=$str_answerer_information."ng&#224;y : ".$v_answer_date.")";
}?>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr><td height="5"></td></tr>
	
	<tr>
		<td class="page_title" width="100%"><?php echo CONST_QA_QUESTION_TITLE; ?></td>
	</tr>	
	<tr>
		<td class="small_title" width="100%"><?php echo $v_question_lable; ?></td>
	</tr>
	<tr>		
		<td class="qa_content_title"><?php echo $v_question_title; ?><small class="normal_label"><?php echo $str_questioner_information;?></small></td>
	</tr>

	<tr align="justify">
		<td class="af_content_label" align="justify"><?php echo _restore_XML_bad_char($v_question_content);?></td>
	</tr>
	<!--Phan hien thi cac file dinh kem cua CAU HOI -->
	<?php
	if ($v_total_question_file > 0) {?> 
		<tr><td height="10"></td></tr>
		<!--tr>
			<td class="file_attach_list"><? echo //CONST_QA_QUESTION_FILE_ATTACH_LABEL;?></td>
		</tr-->
		<tr>
			<td colspan="2">				
				<table width="90%" cellpadding="0" cellspacing="0" >
					<!--Vong lap hien thi cac file da dinh kem van ban--><?				
					for ($i = 0; $i < $v_total_question_file; $i++) {
						$v_qa_file_id =$arr_question_file[$i]['0'];
						$v_file_name = $arr_question_file[$i]['2']; 
						$v_file_url = trim(CONST_QA_URL_PATH_FROM_ROOT) .$v_file_name;
						$v_goto_url = "javascript:filename_onclick('T_ONEGATE_QA_FILE', 'PK_QA_FILE', 'C_FILE_NAME', 'C_FILE_CONTENT'," . strval($v_qa_file_id) . ",'" . $v_file_url ."');" ;
						$target = "";?>
						<tr>
							<td>
								<li class="normal_li">
									<a href="<? echo $v_goto_url; ?>" class="file_attach" <? echo $target;?>><? echo $v_file_name;?></a>
								</li>
							</td>
						</tr><?
						}
					?>							
				</table>
			</td>
		</tr><?
	}	//Dong if 1
	?>
	<tr>
		<td class="small_title" width="100%"><?php echo $v_answer_lable; ?></td>
	</tr>	
	<tr>
		<td class="af_content_label">
		<?php echo $str_answerer_information;?>
		<?php echo _restore_XML_bad_char($v_answer_content);?></td>
	</tr>
	<!--Phan hien thi cac file dinh kem cua TRA LOI -->
	<?php
	if ($v_total_answer_file > 0) {?> 
		<tr><td height="10"></td></tr>
		<tr>
			<td class="file_attach_list"><? echo //CONST_QA_ANSWER_FILE_ATTACH_LABEL;?></td>
		</tr>
		<tr>
			<td colspan="2">				
				<table width="90%" cellpadding="0" cellspacing="0" >
					<!--Vong lap hien thi cac file da dinh kem van ban--><?				
					for ($i = 0; $i < $v_total_answer_file; $i++) {
						$v_qa_file_id =$arr_answer_file[$i]['0'];
						$v_file_name = $arr_answer_file[$i]['2']; 
						$v_file_url = trim(CONST_QA_URL_PATH_FROM_ROOT) .$v_file_name;
						$v_goto_url = "javascript:filename_onclick('T_ONEGATE_QA_FILE', 'PK_QA_FILE', 'C_FILE_NAME', 'C_FILE_CONTENT'," . strval($v_qa_file_id) . ",'" . $v_file_url ."');" ;
						$target = "";?>
						<tr class="file_attach">
							<td>
								<li class="normal_li">
									<a href="<? echo $v_goto_url; ?>" class="file_attach" <? echo $target;?>><? echo $v_file_name;?></a>
								</li>
							</td>
						</tr><?
						}
					?>							
				</table>
			</td>
		</tr><?
	}	//Dong if 1?>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr><td>&nbsp;</td></tr>
	<tr>
		<td align="center"><a class="normal_button" href="<?php echo $_URL_BACK?>"><?php echo _CONST_BACK_BUTTON; ?></a></td>
	</tr>
</table>
